Some NPC.HitModifiers.SourceDamage patches:#100
Some NPC.HitModifiers.SourceDamage patches:#100Habble53 wants to merge 0 commit intoCalamityTeam:1.4.4from
Conversation
Ozzatron
left a comment
There was a problem hiding this comment.
All of the changes are sound except for Frost Armor. Frost Armor's current behavior becoming multiplicative presents a significant balance concern. Remove the changes to Frost Armor and this PR is fine as-is; the team will change Frost Armor internally.
The Frost Armor tweak is not necessarily multiplicative in the way you'd imagine. I've done a small hack there to imitate the same effect its additiveness would have, as TargetDamageMultiplier is a MultipliableFloat which means it can't be simply added onto. In the meanwhile, I added a small safety check that I just noticed was lacking with my implementation. |
Ozzatron
left a comment
There was a problem hiding this comment.
Your counterargument is accepted. Good catch on the safety check. In truth we'll likely have to rewrite how Frost Armor works either way but I agree with you that this is good enough for now.
The merge-base changed after approval.
Replaced globally available projectile instances of HitModifiers.SourceDamage modification with HitModifiers.TargetDamageMultiplier, so as to prevent it from being inherited in NPC.HitInfo.SourceDamage and doubled up in cases where other mods may spawn additional OnHit projectiles that inherit HitInfo.SourceDamage for accurate OnHit interactions. Recommended to move to HitModifiers.FinalDamage and redone as such or implement defensive mechanisms that don't let additional projectiles inherit SourceDamage, like globally tagging projectiles (and their children by chaining projectile tags with e.g.
source is EntitySource_Parent parent && parent.Entity is Projectile proj && proj.Calamity().WeaponSource) in OnSpawn by checking EntitySource_ItemUse_WithAmmo. A few other less important examples were left as is, including Thanatos closed vent DR and GFB seed interaction(s?) like Profaned Guardians.